package com.gzx.plugin.ams.xxl;

import com.gzx.plugin.ams.modular.reminder.service.GzxRenewalService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import vip.xiaonuo.common.tenant.TenantContext;
import vip.xiaonuo.common.util.CommonDateUtil;

/**
 * @author zjt
 * @description 续费提醒
 * @date 2025/6/24 17:53
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RenewalXxlJobHandler {

    private final GzxRenewalService renewalService;

    @XxlJob("renewalNoticeJobHandler")
//    @CommonCheckInstanceOnline
    public void renewalNoticeJobHandler() {
        log.info("XxlJob定时任务启动-------续费通知-------->{}", CommonDateUtil.getCurrentTimeStr());
        TenantContext.ignoreHandle(renewalService::renewalNotice);
    }
}
